Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook connect example #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raulvejar
Copy link

Includes code example of how to use Facebook connect to integrate facebook into a rhodes app by using a redirect service to deal with Rhode's dynamic ports and Facebook requirements that redirect urls are defined in the configuration of the facebook app

@mull
Copy link

mull commented Feb 17, 2012

This code does not work anymore, at least I'm getting errors. Perhaps it needs to be updated?

@raulvejar
Copy link
Author

It still works (just checked it). Of course you would have to update the rakefile and build.yml if you are using the latest version of Rhodes framework.
What problem are you getting?

@mull
Copy link

mull commented Feb 17, 2012

That must be the problem then, I'm using the latest version of Rhodes. After logging in to facebook I just get a blank black page. Oh and after clicking the button "check if like..." I get a quick flash of "error loading page". Perhaps this is all related to the rakefile & build.yml. Thanks for the quick response!

@raulvejar
Copy link
Author

Mmm... from your description it sounds like it is something else (if it was a rakefile/build problem you wouldn't be able to launch the app)... what platform/emulator are you using to test?

@mull
Copy link

mull commented Feb 17, 2012

I used android through rhosimulator, only thing I have working at the moment because of some javac issues.

@raulvejar
Copy link
Author

Mac or Windows? I'm testing it in windows and it works fine under those settings...
From your description it sounds like a problem between the facebook authorization dialog and the browser inside your rhosimulator. Have you managed to authorize the app? Do you see a facebook login dialog of some sort?

@mull
Copy link

mull commented Feb 17, 2012

Yep I got logged in & authorized the app. I am running from Mac.

On Fri, Feb 17, 2012 at 5:48 PM, Raul Vejar <
[email protected]

wrote:

Mac or Windows? I'm testing it in windows and it works fine under those
settings...
From your description it sounds like a problem between the facebook
authorization dialog and the browser inside your rhosimulator. Have you
managed to authorize the app? Do you see a facebook login dialog of some
sort?


Reply to this email directly or view it on GitHub:

#2 (comment)

@raulvejar
Copy link
Author

Try deauthorizing the app from your facebook account settings and run the demo again (sometimes facebook gets messed up that way)

I'll try running the demo on my mac and see if it is having any issues. BTW: I'm running Rhodes 3.2.3, it shouldn't make a difference though...

@mull
Copy link

mull commented Feb 17, 2012

Same thing. I'm running 3.3.2. "Hopefully" you'll run into the same issues
when you run it on your Mac. We'll see. :)

On Fri, Feb 17, 2012 at 5:52 PM, Raul Vejar <
[email protected]

wrote:

Try deauthorizing the app from your facebook account settings and run the
demo again (sometimes facebook gets messed up that way)

I'll try running the demo on my mac and see if it is having any issues.
BTW: I'm running Rhodes 3.2.3, it shouldn't make a difference though...


Reply to this email directly or view it on GitHub:

#2 (comment)

@geo1004
Copy link

geo1004 commented Apr 17, 2012

I have the same issue on 3.3.3. I get the very quick page "error loading page". Anyone knows how to fix it? Except this issue everything works fine.

@geo1004
Copy link

geo1004 commented Apr 17, 2012

Found the answer... By using rel="external" on your link you bypass the AJAX part of the loading -- this means the page loads, but it's not injected into the DOM.
Sorry for the newbie question!

@raulvejar
Copy link
Author

This code was written for the old jqtouch, keep that in mind when copyin and pasting the view code

@adbeel92
Copy link

I have a problem... After logging, it shows website of Facebook..
i though it should show a Fb permissions and then go back -> app.. with a message...

def facebook_check_callback
@message = nil
if @params['entered'].to_s == 'true'
@message = "You really like Rhomobile! Rock on!"
else
@message = "You don't like Rhomobile! Why?"
end
end

Connect Fb -> Presentation before login -> login -> Website (Facebook) ¿?

I think it's about " redirect_uri " and localhost app.. because its a mobile app...

@raulvejar
Copy link
Author

Yes, it should go back to the app, it's built to work that way and with a
mobile app in mind so it's not because of that.
It should show the facebook log in prompt, then the permissions prompt and
then go back to the app

The example was written with jqtouch in mind, if you are using jquery
mobile you should add rel="external" on your link you bypass the AJAX part
of the loading

On Sat, Apr 21, 2012 at 2:24 AM, Eduardo Adbeel Arenas <
[email protected]

wrote:

I have a problem... After logging, it shows website of Facebook..
i though it should show a Fb permissions and then go back -> app.. with a
message...

def facebook_check_callback
@message = nil
if @params['entered'].to_s == 'true'
@message = "You really like Rhomobile! Rock on!"
else
@message = "You don't like Rhomobile! Why?"
end
end

Connect Fb -> Presentation before login -> login -> Website (Facebook) ¿?

I think it's about " redirect_uri " and localhost app.. because its a
mobile app...


Reply to this email directly or view it on GitHub:

#2 (comment)

@adbeel92
Copy link

I just add rel="external" on the link:

a href="<%= url_for :action => :connect_to_facebook %>" rel="external"> Connect </a

This link goes to login...
But afeter logging, i shows the same: website of Facebook

I think it's about localhost app

Im using emulator Android 2.1. Rhodes 3.3.2 Ruby 1.9.2

@raulvejar
Copy link
Author

what url are you navigating to? Use the log console to figure out the exact
url you are using

On Sat, Apr 21, 2012 at 12:34 PM, Eduardo Adbeel Arenas <
[email protected]

wrote:

I just add rel="external" on the link: Connect
This link goes to login...
But afeter logging, i shows the same: website of Facebook


Reply to this email directly or view it on GitHub:

#2 (comment)

@adbeel92
Copy link

RUN!
I used my appId... but when I write your appId... Work!

So.. my configuration is bad. Can you tell me what do you do in developers.facebook.com, please?

@raulvejar
Copy link
Author

I'm attaching 2 screens with the settings for the rhomobile like app.

BTW: I speak Spanish, if that is your first language...
[image: Inline image 1]

[image: Inline image 2]
On Sat, Apr 21, 2012 at 1:52 PM, Eduardo Adbeel Arenas <
[email protected]

wrote:

RUN!
I used my appId... but when I write your appId... Work!

So.. my configuration is bad. Can you tell me what do you do in
developers.facebook.com, please?


Reply to this email directly or view it on GitHub:

#2 (comment)

@adbeel92
Copy link

Dónde están los screens?

@raulvejar
Copy link
Author

Estan embebidos en el mail anterior

On Sat, Apr 21, 2012 at 6:54 PM, Eduardo Adbeel Arenas <
[email protected]

wrote:

Dónde están los screens?


Reply to this email directly or view it on GitHub:

#2 (comment)

@adbeel92
Copy link

Cómo los veo? solo veo:
[image: Inline image 1]

[image: Inline image 2]

@raulvejar
Copy link
Author

Con cualquier cliente de correo que te muestre imagenes dentro de los
mails... demoran un poco en descargar....

A la noche te las mando en un nuevo mail como attachments esta vez si aun
tienes problemas...

On Mon, Apr 23, 2012 at 1:36 AM, Eduardo Adbeel Arenas <
[email protected]

wrote:

Cómo los veo?


Reply to this email directly or view it on GitHub:

#2 (comment)

@adbeel92
Copy link

ok gracias.

@adbeel92
Copy link

Me decia del url el cual navega mi app, no?
Qué pongo en la consola para averiguar el URL exacto que estoy utilizando

@raulvejar
Copy link
Author

Tienes que poner el url del servicio de redireccion que estas usando, en el caso del app de demostracion que usa el sample: http://redirect.me

@cpinan
Copy link

cpinan commented Dec 10, 2012

Hola como están, bueno a mi si me corre sin problema pero no arranca en el aplicativo de FB sino en una ventana externa. Hay forma de ejecutarlo en el app de FB? Saludos.

@danytoz
Copy link

danytoz commented Aug 19, 2013

Thank you guys, rel="external". Fixed it for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants